package com.cardvalue.sys.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cardvalue.sys.R;
import com.cardvalue.sys.base.BaseActivity;
import com.cardvalue.sys.tool.DataCleanManager;
import com.cardvalue.sys.tool.VersionUtil;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 关于小企额
 */
public class AboutActivity extends BaseActivity {
    @Bind(R.id.tv_about_version) TextView mVersionView;
    @Bind(R.id.ll_about_wipe_cache_click) LinearLayout mWipeCacheView;
    @Bind(R.id.tv_about_wipe_cache_result) TextView mResultCacheView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        ButterKnife.bind(this);
        setHeaderFields(0, R.string.titile_activity_about, 0, R.mipmap.back, 0, 0);
        mVersionView.setText(getString(R.string.app_name) + VersionUtil.getVersionName(this));
        mResultCacheView.setText("共有缓存" + DataCleanManager.getTotalCacheSize(this));
    }

    @OnClick(R.id.tv_about_wipe_cache_result) void clickWipeCache() {
        DataCleanManager.clearAllCache(this);
        mResultCacheView.setText("共有缓存0K");
    }
}
